// 账号接入模块
// 引入工具函数
import request from '@/utils/request'

// 登录接口函数
export const checkLoginReq= data=>{
    return request({
        method:'post',
        url:'/users/checkLogin',
        data,
    })
}
//检测重复接口函数
export const checkUserRepeatReq=data=>{
    return request({
        method:'post',
        url:'/users/repeat',
        data
    })
}
//添加接口函数
export const addUserReq = data => {
    //返回axios接口调用结果
    return request({
      method: 'post',
      url: '/users/add',
      data,
    })
  }
  //获取用户列表接口
  export const getUserListReq=params=>{
    return request({
        method:'get',
        url:'/users/list',
        params,
    })
  }
    //删除账号接口
    export const delUserReq=params=>{
        return request({
            method:'get',
            url:'/users/del',
            params,
        })
      }
    //   修改接口函数
    export const editUserReq=data=>{
        return request({
            method:'post',
            url:'/users/edit',
            data
        })
    }

    //批量删除用户
export const batchDelUserReq = data => {
    return request({
      method: 'post',
      url: '/users/batchdel',
      data,
    })
  }
//   获取用户信息
 export const getUserInfoReq=()=>{
    return request({
        method:'get',
        url:'/users/info'
    })
 }

//  修改头像接口

export const updateUserAvatarReq=(params=>{
  return request({
    method:'get',
    url:'/users/avataredit',
    params
  })
})

// 检查旧密码是否正确
export const checkPsdReq=(params=>{
  return request({
    method:'get',
    url:'/users/checkoldpwd',
    params
  })
})
// 9.修改密码
export const updataPsdReq = data => {
  return request({
    method: 'post',
    url: '/users/editpwd',
    data,
  })
}


// 20.获取商品列表
export const getGoodsReq=(params=>{
  return request({
    method:'get',
    url:'/goods/list',
    params
  })
})
// 删除商品
export const delGoodsReq=(params)=>{
  return request({
    method:'get',
    url:'/goods/del',
    params

  })
}
// 18.商品图片上传接口
export const updataGoodsReq=data=>{
  return request({
    method:'post',
    url:'/goods/add',
    data
})
}
